package com.mo.ld.activity.view

import android.os.Bundle
import com.mo.ld.databinding.ActProgressviewBinding
import com.mo.lib.ui.activity.BaseVbActivity
import com.mo.lib.utils.setClick


/**
 * @ author：mo
 * @ data：2022/4/6:16:31
 * @ 功能：打字机样式TextView ：https://gitee.com/jenly1314/SuperTextView
 *
 */
class ProgressViewsActivity : BaseVbActivity<ActProgressviewBinding>() {
    private val mShaderColors = intArrayOf(-0xb01554, -0x5722af, -0x172cf1, -0x5722af, -0xb01554)
    override fun initView(savedInstanceState: Bundle?) {
        super.initView(savedInstanceState)
        viewBinding.cbTick.setOnCheckedChangeListener { _, isChecked ->
            viewBinding.cpv.setShowTick(isChecked)
        }

        viewBinding.cbTurn.setOnCheckedChangeListener { _, isChecked ->
            viewBinding.cpv.setTurn(isChecked)
        }

        viewBinding.btn1.setClick {
            viewBinding.cpv.setProgressColors(mShaderColors);
            viewBinding.cpv.showAnimation(100, 3000);
        }
        viewBinding.btn2.setClick {
            viewBinding.cpv.setProgressColors(mShaderColors);
            viewBinding.cpv.showAnimation(100,0,3000);
        }
        viewBinding.btn3.setClick {
            viewBinding.cpv.startAngle
            viewBinding.cpv.setProgressColor(0xFF4FEAAC.toInt());
            viewBinding.cpv.showAnimation(100,3000);
        }
        viewBinding.btn4.setClick {
            viewBinding.cpv.setProgressColor(0xFF4FEAAC.toInt());
            viewBinding.cpv.showAnimation(100,0,3000);
        }

    }

    override fun initData() {
    }

}